<?PHP

//define the path as relative
// DEBUG  $path = "./audiosubmissions/";
$path = "../../public/speechsubmissions/";

$dir_handle = @opendir($path) or die("Unable to open $path");
echo "<b>Speech Submissions Awaiting Processing</b><br/>";
echo "===========================<br/>";

$fileList[]=""; //create global variable??
while (false !== ($file = readdir($dir_handle))) {
    if ($file != "." && $file != "..") {
	$file =  ereg_replace  (  "\[.*\]"  , ""  , $file  );
	global $filelist;
            $fileList[] = $file;
    }
}

sort($fileList);

foreach ($fileList as $key => $val) {
	if ($val != "") {
	        echo "$val<br>";
	}
}

echo "===========================<br/>";

closedir($dir_handle);
?> 
